QVAC-18135 feat[api]: add FLUX.2 multi-reference fusion and LoRA adapter support to diffusion API#1838
Merged
maxim-smotrov merged 16 commits intoMay 5, 2026
Conversation
… to diffusion API
opaninakuffo
reviewed
May 1, 2026
opaninakuffo
reviewed
May 1, 2026
opaninakuffo
reviewed
May 1, 2026
Address PR review: - shorten lora_apply_mode description in sdcppConfigSchema and drop the external file references the user can't see at usage time - shorten the LoRA JSDoc block in diffusion.ts to the essentials - drop unit tests that effectively re-assert zod built-ins (z.boolean(), z.string().min(1), individual enum members); keep the ABSOLUTE_PATH_PATTERN matrix, the mutual-exclusion refine, and one happy-path per new field Made-with: Cursor
lauripiisang
reviewed
May 1, 2026
…reject conflicting init_image inputs
lauripiisang
approved these changes
May 4, 2026
lauripiisang
left a comment
Contributor
There was a problem hiding this comment.
Both prior threads resolved correctly:
- Fusion validation (
diffusion-tests.ts) — the newfusionFlux2Basichandler runs the fusion test plus a same-seed/prompt baseline withinit_images: undefinedand asserts byte divergence > 1%. Catches the silent txt2img-fallback case exactly as suggested. - Stream-schema mutual-exclusion regression test (
sdcpp-plugin.test.ts) — added, plus amessages.includes("mutually exclusive")substring check that goes one step beyond what was requested.
CI green, gitflow intact, no new high/medium concerns. LGTM.
opaninakuffo
approved these changes
May 4, 2026
NamelsKing
approved these changes
May 4, 2026
Contributor
Author
|
/review |
Contributor
Tier-based Approval Status |
tamer-hassan-tether
pushed a commit
that referenced
this pull request
May 5, 2026
…ter support to diffusion API (#1838) * feat[api]: add FLUX.2 multi-reference fusion and LoRA adapter support to diffusion API * doc[skiplog]: trim verbose lora docs and prune zod-builtin tests Address PR review: - shorten lora_apply_mode description in sdcppConfigSchema and drop the external file references the user can't see at usage time - shorten the LoRA JSDoc block in diffusion.ts to the essentials - drop unit tests that effectively re-assert zod built-ins (z.boolean(), z.string().min(1), individual enum members); keep the ABSOLUTE_PATH_PATTERN matrix, the mutual-exclusion refine, and one happy-path per new field Made-with: Cursor * test[api]: validate FLUX.2 fusion diverges from txt2img baseline and reject conflicting init_image inputs
This was referenced May 16, 2026
Proletter
pushed a commit
that referenced
this pull request
May 24, 2026
…ter support to diffusion API (#1838) * feat[api]: add FLUX.2 multi-reference fusion and LoRA adapter support to diffusion API * doc[skiplog]: trim verbose lora docs and prune zod-builtin tests Address PR review: - shorten lora_apply_mode description in sdcppConfigSchema and drop the external file references the user can't see at usage time - shorten the LoRA JSDoc block in diffusion.ts to the essentials - drop unit tests that effectively re-assert zod built-ins (z.boolean(), z.string().min(1), individual enum members); keep the ABSOLUTE_PATH_PATTERN matrix, the mutual-exclusion refine, and one happy-path per new field Made-with: Cursor * test[api]: validate FLUX.2 fusion diverges from txt2img baseline and reject conflicting init_image inputs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 What problem does this PR solve?
diffusion()API only accepted a singleinit_image.📝 How does it solve it?
init_images: Uint8Array[]toDiffusionClientParamsfor FLUX.2 fusion; mutually exclusive withinit_image(enforced both at compile time via discriminated union and at runtime via Zod refine).increase_ref_indexandauto_resize_ref_image.lorafield, validated as an absolute filesystem path (POSIX, Windows drive-letter, and UNC). Relative paths are rejected because the SDK runs across processes with differing cwds.lora_apply_mode: "auto" | "immediately" | "at_runtime"tosdcppConfigSchema(set atloadModeltime) controlling whether the adapter is fused permanently or applied per-call.@qvac/diffusion-cppto^0.5.0for the underlying addon support and wires the new fields through the bare plugin op and the desktop / mobile / shared test executors.🧪 How was it tested?
sdcpp-plugin.test.tscover:loraabsolute-path validation (POSIX / Windows / UNC accepted; relative, bare-filename, empty, wrong-type rejected),init_imagesshape validation,increase_ref_index/auto_resize_ref_imagetype checks,init_image↔init_imagesmutual exclusion, andlora_apply_modeenum acceptance.diffusion-fusion-flux2-basicadded totests-qvaccovering FLUX.2 fusion with two reference images.🔌 API Changes